package com.example.myapplication.Room.room;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao ///对表进行增删改查
public interface StudentDao {

    ///增加
    @Insert
     void insertStudent(Student... students);

    ///修改
    @Update
     void upDateStudent(Student... students);

    ///删除
    @Delete
     void deleteStudent(Student... students);

    ///删除
    @Query("DELETE FROM Student")
     void deleteAllStudent();

    ///查看
    @Query("SELECT * FROM Student ORDER BY ID DESC")
     List<Student> getAllStudent();
}
